package com.xintonghua.hongyi.adapter;

import android.app.Activity;
import android.os.Bundle;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;

import com.xintonghua.base.BuildConfig;
import com.xintonghua.base.adapter.BaseAdapter;
import com.xintonghua.base.ui.ImageActivity;
import com.xintonghua.base.utils.MyUtils;
import com.xintonghua.hongyi.R;
import com.xintonghua.hongyi.ui.home.StoreDetailActivity;

import java.util.List;

/**
 * 作者：wanxianyi
 * 时间：2018/1/12.
 * 包名：com.xintonghua.hongyi.adapter
 */

public class HomeAdapter extends BaseAdapter<String, HomeAdapter.HomeViewHolder> {

    public HomeAdapter(Activity mActivity, List<String> list) {
        super(mActivity, list);
    }

    @Override
    public int getItemCount() {
        return 50;
    }

    @Override
    public HomeViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = inflater.inflate(R.layout.adapter_home, parent, false);
        view.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Bundle bundle = new Bundle();
                bundle.putInt(BuildConfig.FLAVOR, R.mipmap.user_customer);
                MyUtils.openActivity(mActivity, StoreDetailActivity.class, bundle);
            }
        });
        return new HomeViewHolder(view);
    }

    @Override
    public void onBindViewHolder(HomeViewHolder holder, int position) {

    }


    class HomeViewHolder extends RecyclerView.ViewHolder {

        public HomeViewHolder(View itemView) {
            super(itemView);
        }
    }
}